package com.WOWTradeNews.tablet;


import com.WOWTradeNewsTest.R;
import android.content.Intent;
import android.os.Bundle;

public class TradeNewsDetail extends Default {
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);        
        super.init();

        Bundle bundle = this.getIntent().getExtras();
        if(bundle!=null){
        	String _id = bundle.getString("newsID");
        	String newsType = bundle.getString("newsType");
        	ib1.setBackgroundResource(R.drawable.menu01b);
        	ib2.setBackgroundResource(R.drawable.menu02b);
        	ib3.setBackgroundResource(R.drawable.menu03b);
        	ib4.setBackgroundResource(R.drawable.menu04b);
        	ib5.setBackgroundResource(R.drawable.menu05b);        	
        	if(newsType.equals("1")){
            	ib1.setBackgroundResource(R.drawable.menu01a);
        	}
        	else if(newsType.equals("2")){
            	ib2.setBackgroundResource(R.drawable.menu02a);
        	}
        	else if(newsType.equals("3")){
            	ib3.setBackgroundResource(R.drawable.menu03a);
        	}
        	else if(newsType.equals("4")){
            	ib4.setBackgroundResource(R.drawable.menu04a);
        	}
        	else if(newsType.equals("5")){
            	ib5.setBackgroundResource(R.drawable.menu05a);
        	}        	
        	
            Intent intent = new Intent(TradeNewsDetail.this, NewsDetail.class);      
            bundle.putString("newsID", _id);
                
            intent.putExtras(bundle);
            chooseActivity(intent, R.id.tab_content_layout);          		
        }
    }   
}